package com.sskj.hhrt.login;

import com.sskj.hhrt.BasePresenter;
import com.sskj.hhrt.api.ApiObserver;
import com.sskj.base.data.User;
import com.sskj.base.utils.MD5Utils;
import com.sskj.base.utils.RxUtils;
import com.sskj.hhrt.api.Api;
import com.sskj.hhrt.login.data.LoginBean;


/**
 * @author Hey
 * Create at  2019/03/21
 */
class LoginPresenter extends BasePresenter<LoginActivity> {

    public void login(String account, String ps) {
        Api.getInstance().login(account,ps)
                .compose(RxUtils.transform())
                .subscribe(new ApiObserver<LoginBean>(this, true) {
                    @Override
                    public void onSuccess(LoginBean data) {
                        mView.loginSuccess(data);
                    }
                });
    }
}
